<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模板抽离</title>
    <script src="./js/vue.js"></script>
</head>
<body>

<div id="app">
    <cpn3></cpn3>

</div>
<template id="tmp">
    <div>
        <h3>语法糖格式</h3>
        <h4>sa</h4>
        <h2>{{message}}</h2>
    </div>
</template>
<script>
    //语法糖
    Vue.component("cpn3",{
        template:"#tmp",
        data(){
            return{
                message: "组件中的数据"
            }
        }
    });

    let vm = new Vue({
        el: "#app"
    })

</script>

</body>
</html>